
Version:=5.1.39
ModuleName:=mysql

Objcet:=$(ModuleName).tgz
ObjectDir:=$(ModuleName)-$(Version)
ObjcetSource:=$(ModuleName)-$(Version).tar.gz

DependFiles:=

InstallDirTmp:=usr/local/
InstallDir:=/$(InstallDirTmp)
InstallLib:=$(InstallDirTmp)/lib
UserHome:=

Config:=./configure --with-mysqld-ldflags=-all-static --enable-assembler 

Patch:= 

.PHONY: all clean dist_clean

null:

all:$(Objcet) 

$(Objcet):$(ObjcetSource)
	rm -rf etc && mkdir etc && ln -s /usr/local/share/mysql/my-medium.cnf /etc/my.cf
	tar -xzf $(ObjcetSource)
	$(Patch)
	cd $(ObjectDir) && $(Config)
	$(MAKE) -C $(ObjectDir) 
	$(MAKE) -C $(ObjectDir) install DESTDIR=`pwd`/
	rm -rf usr/local/include usr/local/mysql-test usr/local/share/info usr/local/share/man usr/local/sql-bench
	tar -cvzf $(Objcet) usr etc

patch:
	mv $(ObjectDir) $(ObjectDir).new
	tar xzvf $(ObjcetSource)
	diff -Nur $(ObjectDir) $(ObjectDir).new > $(ObjectDir).patch

clean:
	rm -rf usr $(Objcet) etc

dist_clean:clean
	rm -rf $(ObjectDir) $(ObjcetSource) *.tar.gz *.new *.tar.bz2
	
include ../Makefile.Res
